<?php

namespace Xrfg\Core\Trading\SystemAccount\Models;

trait SystemAccountLogHelper
{
    public $numberChange;

    public $proofId;

    public static function boot()
    {
        parent::boot();

        static::updating(function ($model) {
            ++$model->version;
        });
    }

    public function numberIncrement($number)
    {
        $this->number = bcadd($this->number, $number);
        $this->numberChange = +$number;
    }

    public function numberDecrement($number)
    {
        $this->number = bcsub($this->number, $number);
        $this->numberChange = -$number;
    }
}
